<?php
$installer = $this;
$installer->startSetup();
 
$installer->run("
    CREATE TABLE {$this->getTable('systempoint_viplist')} (
        `vip_id` int(11) NOT NULL AUTO_INCREMENT,
        `email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
        `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
        PRIMARY KEY (`vip_id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

    CREATE TABLE {$this->getTable('systempoint_userpoint')} (
        `userpoint_id` int(11) NOT NULL AUTO_INCREMENT,
        `email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
        `group_title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
        `shadow_point` int(11) DEFAULT '0',
        `ordered_point` int(11) DEFAULT '0',
        `shared_point` int(11) DEFAULT '0',
        `user_point` int(11) DEFAULT '0',
        `add_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
        `exp_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
        PRIMARY KEY (`userpoint_id`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC ;

    CREATE TABLE {$this->getTable('systempoint_expire')} (
        `expire_id` int(11) NOT NULL AUTO_INCREMENT,
        `number_of_days` int(11) DEFAULT '0',
        `percent_lose` float DEFAULT '0',
        PRIMARY KEY (`expire_id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

    CREATE TABLE {$this->getTable('systempoint_log')} (
        `log_id` int(11) NOT NULL AUTO_INCREMENT,
        `user_email` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
        `title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
        `point` int(11) DEFAULT NULL,
        `log_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
        PRIMARY KEY (`log_id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

    CREATE TABLE {$this->getTable('systempoint_membership')} (
        `membership_id` int(11) NOT NULL AUTO_INCREMENT,
        `title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
        `number_of_point` int(11) DEFAULT '0',
        `percent_discount` float DEFAULT '0',
        `icon_path` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
        PRIMARY KEY (`membership_id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

    CREATE TABLE {$this->getTable('systempoint_setting')} (
        `setting_id` int(11) NOT NULL AUTO_INCREMENT,
        `register_point` int(11) DEFAULT '0',
        `share_point` int(11) DEFAULT '0',
        `register_text` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
        `share_text` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
        PRIMARY KEY (`setting_id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
");
 
$installer->endSetup();